<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/testTpl1.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <!-- InstanceBeginEditable name="doctitle" -->
    <title>TestPage</title>
    <!-- InstanceEndEditable -->
    <!-- InstanceBeginEditable name="head" -->
    <!-- InstanceEndEditable -->
    <link rel="stylesheet" type="text/css" href="../style/google/KitchenSink.css">
    <!-- InstanceBeginEditable name="additionalStyle" -->
    <!-- InstanceEndEditable -->

    <script type="text/javascript">
    var djConfig = {
        isDebug: true
        ,debugAtAllCosts: true
    };
    </script>

    <script type="text/javascript" src="../../../trimpath/template-1.0.38.js"></script>
    <script type="text/javascript" src="../../../dojo/deploy/dojo.js"></script>
    <script type="text/javascript" src="../../../dojo-lotex/dojo-lotex.js"></script>
    <script type="text/javascript" src="../../velcro.js"></script>

    <!-- InstanceBeginEditable name="dojoRequire" -->

    <script type="text/javascript">
    dojo.require("lotex.html.Html");
    dojo.require("lotex.io");

    dojo.hostenv.writeIncludes();
    </script>

    <!-- InstanceEndEditable -->
    <!-- InstanceBeginEditable name="headScript" -->

    <script type="text/javascript">
velcro.sql("select id from selectitem where objname='签约客户'");
d(1);
velcro.sql("select id from selectitem where objname='签约客户'");
d(2);
velcro.sql("select id from selectitem where objname='签约客户'");
d(3);
velcro.sql("select id from selectitem where objname='签约客户'");
d(4);
var s = "    低值易耗品";
/*
dojo.declare("TreeFilePaser", null,
    function(filecontent) {
        this._content = filecontent;
    },
{
}
*/

TreeFilePaser = function(content) {
    var ca = content.split("\n");
    ft = new lotex.util.TreeNode("_ROOT_"));

    var sc;
    var lastNode = ft;;
    var lastSpace = 0;
    for(var i=0;i<ca.length;i++) {
        lastNode = new lotex.util.TreeNode(ca[i]));
        sc = lotex.string.prespace(ca[i]);

        if(sc>lastSpace) lastNode.addChild();
        else if(sc==lastSpace) lastNode.addBrother();
        else if(sc<lastSpace) lastNode.getParent().addBrother();
        lastSpace = sc;
    }

}


    var kw = {
        url: lotexConfig.resurl + "/selectitem/opu.selectitem",
        sync: true,
        mimetype: "text/plain",
        load: function(type, data, evt) {
            TreeFilePaser(data);
        },
        error: function(t, e) {
            alert("Error!");
            dd(t, e);
        }
    };
    dojo.io.bind(kw);

    </script>

    <!-- InstanceEndEditable -->
</head>
<body>
    <table style="width: 100%" cellspacing="0" cellpadding="0">
        <tbody>
            <tr>
                <td style="vertical-align: top" align="left">
                    <div class="ks-Info">
                        Testpage</div>
                </td>
            </tr>
            <tr>
                <td style="vertical-align: top" align="left">
                    <table class="ks-Sink" cellspacing="0" cellpadding="0">
                        <tbody>
                            <tr>
                                <td style="vertical-align: top; width: 100%; height: 100%" align="left">
                                    <div id="container">
                                        <!-- InstanceBeginEditable name="htmlContainer" -->
                                        <!-- InstanceEndEditable -->
                                    </div>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </td>
            </tr>
        </tbody>
    </table>
    <fieldset>
        <legend>Output</legend>
        <div id="debug.output">
        </div>
    </fieldset>
</body>
<!-- InstanceEnd --></html>
